import Vue from 'vue';
import Router from 'vue-router';
Vue.use(Router);

const SignIn = () =>import('./../views/signIn/SignIn.vue');
const Register = () =>import('./../views/register/Register.vue');
const Profile = () => import('./../views/profile/Profile.vue');
const Common = () => import('../views/profile/children/Common.vue');
const Adress = () => import('./../views/profile/children/Adress.vue');
const Order = () => import('./../views/profile/children/Order.vue')
const ChangePassword = () => import('./../views/profile/children/ChangePassword.vue');
const Collection = () => import('./../views/profile/children/Collection.vue');
const History = () => import('./../views/profile/children/History.vue');
const Integral = () => import('./../views/profile/children/Integral.vue');
const User = () => import('./../views/profile/children/User.vue');
const Business = () => import('./../views/business/Business.vue');
const MerchantLogin = () => import('./../views/business/children/MerchantLogin.vue');
const BusinessRegister = () => import('./../views/business/children/BusinessRegister.vue');
const AddAccount = () => import('./../views/business/children/AddAccount.vue');
const GoodSubject = () => import('./../views/business/children/GoodSubject.vue')
const AllGoods = () => import('./../views/business/children/AllGoods.vue')
const BusinessOrder = () => import('./../views/business/children/BusinessOrder')
const BaseSetUp = () => import('./../views/business/children/BaseSetUp')
const BusinessChat = () => import('./../views/business/children/BusinessChat')
const Notice = () => import('./../views/business/children/Notice')
const Home = () => import('./../views/home/Home.vue');
const GoodsClass = () => import('../views/goodsClass/GoodsClass.vue');
const Detail = () => import('../views/detail/Detail')
const Settlement = () => import('../views/settlement/Settlement')
const LuckDraw = () => import('../views/luckdraw/LuckDraw')
const router = new Router({
    routes: [
        {
            path: '/',
            redirect: '/home'
        },
        {
            path: '/home',
            component: Home,
        },
        {
            path: '/goodsclass/:id',
            component: GoodsClass
        },
        {
            path: '/signIn',
            component: SignIn
        },
        {
            path: '/register',
            component: Register
        },
        {
            // path: '/detail/:goodsId',
            path: '/detail',
            component: Detail
        },
        {
            path: '/settlement',
            component: Settlement
        },
        {
            path: '/luckDraw',
            component: LuckDraw
        },

        {
            path: '/profile',
            component: Profile,
            children: [
                {
                    path: '/',
                    redirect: '/order'
                },
                {
                    path: '/common',
                    component: Common
                },
                {
                    path: '/order',
                    component: Order
                },
                {
                    path: '/adress',
                    component: Adress
                },
                {
                    path: '/changepassword',
                    component: ChangePassword
                },
                {
                    path: '/collection',
                    component: Collection
                },
                {
                    path: '/history',
                    component: History
                },
                {
                    path: '/integral',
                    component: Integral
                },
                {
                    path: '/user',
                    component: User
                }

            ]
        },
        {
            path: '/business/signIn',
            component: MerchantLogin
        },
        {
            path: '/business/register',
            component: BusinessRegister
        },
        {
            path: '/business',
            component: Business,
            children: [
                {
                    path: '/business/addaccount',
                    component: AddAccount
                },
                {
                    path: '/business/allgoods',
                    component: AllGoods
                },
                {
                    path: '/business/goodsubject',
                    component: GoodSubject
                },
                {
                    path: '/business/orders',
                    component: BusinessOrder
                },
                {
                    path: '/business/baseSet',
                    component: BaseSetUp
                },
                {
                    path: '/business/notice',
                    component: Notice
                },
                {
                    path: '/business/chat',
                    component: BusinessChat
                }

            ]
        }
    ],
    mode: 'history'
})
export default router
